﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;

using Wicresoft.Shell.Core;
using Wicresoft.Shell.Interfaces;
using Wicresoft.Shell.Logic;

namespace Wicresoft.Shell.Package.AppExp
{
    sealed class ConnectManagerService : IConnectManagerService, SConnectManagerService
    {
        #region Fields

        private AppExpPackage m_AppExpPkg;

        #endregion

        #region Constructor

        public ConnectManagerService(AppExpPackage appExpPkg)
        {
            Debug.Assert(null != appExpPkg);

            m_AppExpPkg = appExpPkg;
        }

        #endregion

        #region Methods

        public void ConnectToDB(object cnnInfo)
        {
            MyToolWindow window = null;

            window = m_AppExpPkg.ShowAppExplorerWindow();
            Workspace.Connect(cnnInfo as ConnectInfoType);
            window.RefreshWorkspaceData();
        }

        #endregion
    }
}
